<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Title</title>
</head>
<body>
 <div id="app">
    <cpn></cpn>

   <cpn2></cpn2>
  </div>


     <script src="../js/vue.js"></script>
     <script>
       //全局组件 语法糖注册的，比较简单
       Vue.component('cpn',{
         template: `
            <div>
              <h2>我是标题</h2>
              <p>哈哈哈</p>
            </div>
         `
       })

       const app=new Vue({
         el: '#app',
         data: {
           message:'你好vue',
         },
         //局部组件 语法糖
         components:{
           'cpn2': {
             template: `
                <div>
                  <h2>我是标题2</h2>
                  <p>哈哈哈2</p>
                </div>
             `
           }
         }
       })
     </script>
</body>
</html>